import request from "@/utils/request";
// 获取全部
export const getMedicine = (MedicineRequestData) => {
  return request.request({
    url: `/admin/med/pages`,
    method: "POST",
    data:MedicineRequestData,
  });
}

//更加id查询
export const getMedicineDataOne = (id) => {
  return request.request({
    url: `/admin/med/one/${id}`,
    method: "GET",
  });
}

//查询药品类型
export const getMedicineType = () => {
  return request.request({
    url: `/admin/med/type`,
    method: "GET",
  });
}
//查询药品单位
export const getMedicineUnit = () => {
  return request.request({
    url: `/admin/med/unit`,
    method: "GET",
  });
}

// 删除
export const deleteMedicine = (id) => {
  return request.request({
    url: `/admin/med/delete/${id}`,
    method: "get",
  });
}

//更新
export const updateMedicine = (MedicineRequestData) => {
  return request.request({
    url: `/admin/med/update`,
    data:MedicineRequestData,
    method: "post",
  });
}


//添加
export const addMedicine = (MedicineRequestData) => {
  return request.request({
    url: `/admin/med/add`,
    data:MedicineRequestData,
    method: "post",
  });
}

//配药
export const putMedicine = (MedicineRequestData) => {
  return request.request({
    url: `/admin/med/putmedicine`,
    data:MedicineRequestData,
    method: "post",
  });
}